package com.gaogzhen.intro.commonMethod;

import lombok.extern.slf4j.Slf4j;

import java.util.concurrent.TimeUnit;
import java.util.concurrent.locks.LockSupport;

@Slf4j(topic = "cm.CMPark")
public class CMPark {
    public static void main(String[] args) throws InterruptedException {
        Thread t1 = new Thread(() -> {
            log.debug("park...");
            LockSupport.park();
            log.debug("unpark...");
            log.debug("线程状态:{}", Thread.interrupted());
            LockSupport.park();
            log.debug("unpark...");
        });

        t1.start();
        TimeUnit.SECONDS.sleep(1);
        t1.interrupt();
    }
}
